package com.qs.user.pay.util;

import android.os.CountDownTimer;

import me.goldze.mvvmhabit.utils.KLog;

/**
 * Created by Walter on 2019/4/
 * shiys
 */

public class TimeCountUtil extends CountDownTimer {


    private getTime getTime ;

    public void setGetTime(TimeCountUtil.getTime getTime) {
        this.getTime = getTime;
    }

    public TimeCountUtil(long millisInFuture, long countDownInterval) {
        super(millisInFuture, countDownInterval);
    }

    @Override
    public void onTick(long millisUntilFinished) {
//        btnGetcode.setClickable(false);
//        btnGetcode.setText("("+millisUntilFinished / 1000 +")秒后重发");

        getTime.onTick(millisUntilFinished);

    }

    @Override
    public void onFinish() {
//        btnGetcode.setText("获取验证码");
//        btnGetcode.setClickable(true);
        getTime.onFinish();
    }

    public interface getTime{
        void onTick(long millisUntilFinished);

        void onFinish();
    }

}
